翻訳と辞書
Words near each other
・ Rich Graff
・ Rich Griffith
・ Rich Grove Township, Pulaski County, Indiana
・ Rich Gulch, California
・ Rich Gunnell
・ Rich Gunning
・ Rich Hacker
・ Rich Hale
・ Rich Hall
・ Rich Hall's Cattle Drive
・ Rich Hall's Fishing Show
・ Rich Halley
・ Rich Bisaccia
・ Rich black
・ Rich Blomquist
Rich Booleans
・ Rich Bordi
・ Rich Bottom Farm
・ Rich Boy
・ Rich Boy (album)
・ Rich Bradford
・ Rich Bradley
・ Rich Braham
・ Rich Brauer
・ Rich Brennan
・ Rich Brenner
・ Rich Bride Poor Bride
・ Rich Brightman
・ Rich Brooks
・ Rich Brzeski


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Rich Booleans : ウィキペディア英語版
Rich Booleans

Rich Booleans is a C++ library of macros that can be used in assertions to check conditions, that provide extra information when the condition fails, which helps the programmer in determining the cause of the problem. This is similar to constraints in JUnit, the main difference being that with Rich Booleans there is no clear distinction between the expected value and the checker, e.g. an assertion with a Rich Boolean for equality would be ASSERT(rbEQUAL(a,1)) while in JUnit it would be assertThat(a, eq(1)).
Rich Booleans is developed by ''Q-Mentum''.〔(Q-Mentum )〕
Rich Booleans make it possible to decouple the behaviour of an assertion from the condition it checks. This means a user can write ASSERT(rbEQUAL(a,b)), whereas other frameworks would require ASSERT_EQUAL(a,b); the Rich Booleans allow to separate the functionality in the assertion and the condition, making it possible to have many variations of the assertion and the condition.
If a condition fails it will create an object of the RichBool::Analysis class, which is a base class for different types of analysis. These can be converted to text or processed further to provide the information in them to the developer or user. rbEQUAL(x,y) would create an analysis that holds the text ":`1' == :`2' - nok", showing the expression between < and >, and their values between ` and '. Other Rich Booleans produce longer analyses, e.g. checking string equality will show which characters match and which don't.
Starting in version 2.2 Rich Booleans uses some C++0X features, namely regular expressions and initializer lists, but still works with compilers that don't have these features.
There are over 80 different Rich Booleans.
* Relations between objects, without and with fault tolerance: rbEQUAL, rbLESS, ...
* Bitwise comparisons: rbEQUAL_BITWISE, rbBITS_ON, rbBITS_OFF, rbBITS_ARE ...
* Type checking (with RTTI): rbEQUAL_TYPES, rbHAS_TYPE, ...
* Working on ranges and containers: rbIN_RANGE, rbIN_RANGES, rbIN_CONTAINER, rbIN_CONTAINERS, ... These have an extra argument that tells what kind of check to do, e.g. Sorted, Compare, Has, Unique, IsSubsetOf ...
* String comparisons: rbSTRING, rbSTRING_BEGINS_WITH, rbSTRING_ENDS_WITH, rbSTRING_CONTAINS. These have an extra argument that tells what kind of check to do, e.g. case sensitive or not.
* Checks on strings with C++0X regular expressions: rbREGEXP, rbHAS_REGEXP, ...
* Logical expressions: rbAND, rbOR, rbXOR. These can have Rich Booleans or plain boolean expressions as their arguments.
* File system checks: rbFILE, rbDIRECTORY, rbFILE_EXISTS, rbDIRECTORY_EXISTS, rbDOESNT_EXIST.
* Exceptions: rbEXCEPTION takes an exception as its argument, and uses the information in it.
Some frameworks that use Rich Booleans are the assertion framework ModAssert and the unit testing package UquoniTest.
== See also ==

*UquoniTest
*ModAssert

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Rich Booleans」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.